import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';

class Exercise2Page extends StatefulWidget {
  @override
  Exercise2PageState createState() => new Exercise2PageState();
}

class Exercise2PageState extends State<Exercise2Page> {
  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: Text('个人信息头部效果'),
      ),
      body: Container(
        height: 100,
        color: Colors.white,
        child: Row(
          children: [
            SizedBox(width: 15),
            _circleImage(),
            SizedBox(width: 25),
            Expanded(child: _centerMessage()),
            Icon(Icons.arrow_forward_ios,color: Colors.grey,size: 18),
            SizedBox(width: 15)
          ],
        ),
      ),
    );
  }

  _circleImage() {
    return Container(
      height: 60,
      width: 60,
      decoration: BoxDecoration(
          shape: BoxShape.circle,
          image: DecorationImage(image: AssetImage('images/landscape.jpg'))),
    );
  }

  _centerMessage() {
    return Column(
      mainAxisAlignment: MainAxisAlignment.center,
      crossAxisAlignment: CrossAxisAlignment.start,
      children: [
        Text('陈大头Flutter', style: TextStyle(fontSize: 20)),
        Text('Flutter Android', style: TextStyle(fontSize: 14,color: Colors.grey))
      ],
    );
  }
}
